<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<style type="text/css">
  #tree td{
  padding: 0px;border: 0px;
  }
  #tree table{padding: 0px;border: 0px;}
  </style>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="x-ua-compatible" content="ie=6"/>
<script type="text/javascript" src="${base }scripts/framework/jquery/jquery.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/scripts/framework/dhtmlxtree/dhtmlxcommon.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/scripts/framework/dhtmlxtree/dhtmlxtree.js"></script>
<link href="${pageContext.request.contextPath }/scripts/framework/dhtmlxtree/dhtmlxtree.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
	var tree;
	function inittree(){
		tree=new dhtmlXTreeObject(document.getElementById('tree'),"100%","100%",0);
		tree.setImagePath("${pageContext.request.contextPath }/scripts/framework/dhtmlxtree/imgs/");
		tree.enableCheckBoxes(false);
		tree.enableThreeStateCheckboxes(false);
		tree.enableMultiselection(true);
		tree.enableDragAndDrop(false);
		tree.setXMLAutoLoading("${pageContext.request.contextPath }/test/tree!xml.action");
		tree.loadXML("${pageContext.request.contextPath }/test/tree!xml.action?id=0");
		//tree.insertNewChild(0,"1231","New Node 1",0,0,0,0,"SELECT,CALL,TOP,CHILD",1);
		//tree.insertNewChild("1231",2,"New Node 2",0,0,0,0,"CHILD,CHECKED",0);
		//tree.insertNewChild(2,3,"New Node 3",0,0,0,0,"CHILD,CHECKED",0);
		//tree.insertNewChild(3,"422","New Node 5",0,0,0,0,"CHILD,CHECKED",0);
		//tree.insertNewChild(3,5,"New Node 4",0,0,0,0,"CHILD,CHECKED",0);
		//tree.insertNewChild(5,6,"New Node 4",0,0,0,0,"CHILD,CHECKED",0);
		//tree.insertNewChild(6,7,"New Node 4",0,0,0,0,"CHECKED");
		//tree.insertNewChild(2,8,"New Node 8",0,0,0,0,"CHECKED");
		//tree.setUserData(8,"URL","http:www.126.com");
		//tree.attachEvent("onClick",onNodeSelect);
		tree.attachEvent("onDblClick",onNodeSelect);
		//tree.attachEvent("onCheck",onNodeSelect);
		//tree.closeAllItems(2);
	}
	function onNodeSelect(nodeid){
		window.open(tree.getUserData(nodeid,"url"));
	}
	function showmeesage(){
		var treediv=document.getElementById("tree");
		window.alert(treediv.innerHTML);
	}
</script>
<title>树支持</title>
</head>
<body onload="inittree()">
${pageContext.request.contextPath }
<div id="tree" class="tree">
	
</div>
<button onclick="showmeesage()">查看</button>
</body>
</html>